-
Notifications
You must be signed in to change notification settings - Fork 541
fix aapcs ABI docs, and state where which ABIs are available #1948
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable to me.
Is there somewhere in the compiler that we can easily see these defaults? My understanding is that if the ABI is not specified, the default is always Is aapcs the default for softfloat arm32? |
Correct. And "C" can be identical to other ABIs depending on the target. This PR documents my understanding of these equivalences. Cc @workingjubilee @Amanieu for people that know more about the nitty-gritty details. Basically,
I would think so but I don't know. |
Yes, "C" == "aapcs" on soft-float arm32. |
So if I am understanding correctly, the only way to determine what the behavior of the "C" calling convention is to dig through LLVM source, and each target seems to implement it differently, is that correct? For example aarch32/aarch64 use a method called I'm not entirely clear for stdcall, it says "default for the Win32 API". Why does it explicitly say "API"? Is this saying, this is the default that Microsoft uses for the Win32 API functions but is not the default of "C". That is, on i686-pc-windows-msvc, "C" is different from "stdcall"? Is that correct? "thiscall" is also confusing, as it uses the term "default" for "C++ member functions". So it's not the default for the "C" calling convention? (I'm finding the wording of "default" here confusing, so I'm trying to get clarity here.) |
Yes, that is correct. The default for win32 in general ("C" on that target) is "cdecl".
Yeah that's fair. I went for a most minimal edit here to correct some wrong information. This section could probably use a larger rewrite, but I'm not sure if/when I will have the time for that. |
Fixes #1946.
Regarding ABI availability, this documents a post-rust-lang/rust#137018 world. Some of the combinations documented as "not available" here actually do get accepted but trigger a future-compat warning.